<?php

function whats_north($board,$pos)
{
	if($pos < 6)
		return(null);
	else
		return($board[$pos-5]);
}

function whats_west($board,$pos)
{
	if($pos % 5 == 0)
		return(null);
	else
		return($board[$pos-1]);
}

function whats_south($board,$pos)
{
	if($pos >= 24)
		return(null);
	else
		return($board[$pos+5]);
}

function whats_east($board,$pos)
{
	if($pos % 5 == 4)
		return(null);
	else
		return($board[$pos+1]);
}

function whats_northeast($board,$pos)
{
	if($pos < 5 || $pos % 5 == 4)
		return(null);
	else
		return($board[$pos-4]);
}

function whats_northwest($board,$pos)
{
	if($pos < 5 || $pos % 5 == 0)
		return(null);
	else
		return($board[$pos-6]);
}

function whats_southwest($board,$pos)
{
	if($pos >= 24 || $pos % 5 == 0)
		return(null);
	else
		return($board[$pos+4]);
}

function whats_southeast($board,$pos)
{
	if($pos >= 25 || $pos % 5 == 4)
		return(null);
	else
		return($board[$pos+6]);
}



// knight moves

function whats_knight_northwest($board,$pos)
{
	if($pos < 11 || $pos % 5 == 0)
		return(null);
	else
		return($board[$pos-11]);
}

function whats_knight_northeast($board,$pos)
{
	if($pos < 10 || $pos % 5 == 4)
		return(null);
	else
		return($board[$pos-9]);
}

function whats_knight_eastnorth($board,$pos)
{
	if($pos < 5 || $pos % 5 == 3 || $pos % 5 == 4)
		return(null);
	else
		return($board[$pos-3]);
}

function whats_knight_eastsouth($board,$pos)
{
	if($pos > 22 || $pos % 5 == 3 || $pos % 5 == 4)
		return(null);
	else
		return($board[$pos+7]);
}

function whats_knight_southeast($board,$pos)
{
	if($pos > 18 || $pos % 5 == 4)
		return(null);
	else
		return($board[$pos+11]);
}

function whats_knight_southwest($board,$pos)
{
	if($pos > 19 || $pos % 5 == 0)
		return(null);
	else
		return($board[$pos+9]);
}

function whats_knight_westsouth($board,$pos)
{
	if($pos > 24 || $pos % 5 == 0 || $pos % 5 == 1)
		return(null);
	else
		return($board[$pos+3]);
}

function whats_knight_westnorth($board,$pos)
{
	if($pos < 7 || $pos % 5 == 0 || $pos % 5 == 1)
		return(null);
	else
		return($board[$pos-7]);
}


?>